/*
 * Created by IntelliJ IDEA.
 * User: amrk
 * Date: 25/01/2004
 * Time: 09:07:52
 */
package com.talios.jira.feeds;

import com.intellij.openapi.diagnostic.Logger;

public class QuickSearchFeedBuilder extends ProjectFeedBuilder {
    private static final Logger LOGGER = Logger.getInstance("Jira Browser");
    private String searchFor;

    public QuickSearchFeedBuilder(String searchFor) {
        this.searchFor = searchFor;
    }

    /**
     * @jira INTPLUG-4 Support for Multiple Projects
     */
    public String buildRssFeedUrl(boolean includeUserDetails) {

        StringBuffer buf = getBaseBuffer(includeUserDetails);
        // Ignore unresolved at the moment.
        // buf.append( "&resolution=-1");

        // Search in summary and description.
        // TODO: Implement a custom search form letting the user specify which fields to
        // TODO: search in.
        buf.append("&summary=true");
        buf.append("&description=true");

        buf.append("&query=");
        buf.append(searchFor);

        String rssFeed = buf.toString();
        return rssFeed;

    }

    public String getSearchFor() {
        return searchFor;
    }
}